package fluebot;

/**
 *
 * @author Aksel Kvitberg
 */
public class LogItem {

	public long date;
	public String time;
	public String nick;
	public String hostname;
	public String login;
	public String message;
	public String action;

	public String getEvent() {
		if (message != null) {
			return message;
		} else if (action != null) {
			return action;
		} else {
			return null;
		}
	}

	public String getLastEvent() {
		if (message != null) {
			return "saying " + message;
		} else if (action != null) {
			return "doing: " + action;
		} else {
			return "doing nothing";
		}
	}

	public String getEventLog() {
		String returnStr = "[" + time + "] ";
		if (message != null) {
			returnStr +=  "<" + nick + "> " + message;
		} else if (action != null) {
			 returnStr += "* " + nick + " " + action;
		}
		return returnStr;
	}

	public String getTime(){
		return "[" + time + "]";
	}
}
